// 碰撞管理
// 这是一个单例类

#ifndef ALICE_COLLISION_COLLISION_MANAGER_H_
#define ALICE_COLLISION_COLLISION_MANAGER_H_

#include <SDL.h>

#include "game_map.h"
#include "tile_layer.h"

namespace alice {

class CollisionManager {
  public:
    static CollisionManager* GetInstance() {
      return instance_ = (instance_ == nullptr ? new CollisionManager() : instance_);
    }

    bool CheckCollision(SDL_Rect a, SDL_Rect b);
    bool MapCollision(SDL_Rect a);

  private:
    CollisionManager();

  private:
    static CollisionManager* instance_;
    TileMap layer_tile_map_;
    TileLayer* collision_layer_;
};

}

#endif // !ALICE_COLLISION_COLLISION_MANAGER_H_